package com.api.shopapi.service.impl;

import com.api.shopapi.entity.ActivityOrderRecord;
import com.api.shopapi.entity.ActivityType;
import com.api.shopapi.mapper.ActivityOrderRecordMapper;
import com.api.shopapi.service.ActivityOrderRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.AccessType;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("ActivityOrderRecordServiceImplOne")
public class ActivityOrderRecordServiceImpl implements ActivityOrderRecordService {

    @Autowired
    private ActivityOrderRecordMapper activityOrderRecordMapper;

    @Override
    public
    int insert(ActivityOrderRecord activityOrderRecord){
        return activityOrderRecordMapper.insert(activityOrderRecord);
    }

    @Override
    public
    int delete(String activityOrderRecordCode){
        return activityOrderRecordMapper.delete(activityOrderRecordCode);
    }

    @Override
    public
    ActivityOrderRecord getByActivityOrderRecordCode(String activityOrderRecordCode){
        return activityOrderRecordMapper.getByActivityOrderRecordCode(activityOrderRecordCode);
    }

    @Override
    public
    List<ActivityOrderRecord> ListByActivityOrderCode(String activityOrderCode){
        return activityOrderRecordMapper.ListByActivityOrderCode(activityOrderCode);
    }


    @Override
    public
    PageInfo<ActivityOrderRecord> PageByActivityOrderCode(int pageIndex, int pageSize, String activityOrderCode){
        PageHelper.startPage(pageIndex,pageSize);
        List<ActivityOrderRecord> complaintList =activityOrderRecordMapper.ListByActivityOrderCode(activityOrderCode);
        return new PageInfo<>(complaintList);
    }


}
